package cursojava.struts;



import java.sql.Connection;
import java.sql.PreparedStatement;


public class NumeroDAO{   
         
    public static void save(String [] Registro) throws Exception {
    
    
    Connection c = Datasource.getConnection();
    c.setAutoCommit(false);
    PreparedStatement st = c.prepareStatement("INSERT INTO Numero_Secreto(Nombre, Correo, Numero_Elegido) VALUES (?, ?, ?);");
    st.setString(1, Registro[0]);
    st.setString(2, Registro[1]);
    int Numero = Integer.parseInt(Registro[2]);
    st.setInt(3, Numero);
    st.executeUpdate();
    c.commit();
    } 
    
}






    





    
        
    
